package events
{
	import flash.events.EventDispatcher;
	import flash.events.Event;

	public class GlobalEvents extends EventDispatcher
	{
		
		public static const VIEW_SINGLE:String = "viewSingle";
		public static const VIEW_LIST:String = "viewList";
		public static const HIDE_LIST:String = "hideList";
		public static const HIDE_SINGLE:String = "hideSingle";
		public static const VIEW_SINGLE_LOAD:String = "viewSingleLoad";
		public static const STAGE_RESIZED:String = "stageResized";
		
		private static var _dispatcher:EventDispatcher;
		
		public function GlobalEvents()
		{
		}
		
		public static function get dispatcher():EventDispatcher
		{
			if(!_dispatcher)
				_dispatcher = new GlobalEvents();
			return _dispatcher;
		}
		
		public static function showSingle():void
		{
			_dispatcher.dispatchEvent(new Event(GlobalEvents.VIEW_SINGLE));
		}
		
		public static function showList():void
		{
			_dispatcher.dispatchEvent(new Event(GlobalEvents.VIEW_LIST));
			_dispatcher.dispatchEvent(new Event(GlobalEvents.HIDE_SINGLE));
		}
	}
}